﻿using System.IO;

namespace CommonLib.Save
{
	public interface IBinaryIO
	{
		/// <summary>
		/// 当前保存单位的唯一标识
		/// </summary>
		string SaveKey { get; set; }

		/// <summary>
		/// 获取当前保存单位的二进制数据
		/// </summary>
		//byte[] DataBuffer { get; set; }

		/// <summary>
		/// 将保存数据DataBuffer写入二进制流文件
		/// </summary>
		/// <param name="writer"></param>
		void WriteSaveData(BinaryWriter writer);

		/// <summary>
		/// 从二进制流文件中读取保存数据
		/// </summary>
		/// <param name="reader"></param>
		void ReadSaveData(BinaryReader reader);

		/// <summary>
		/// 清除当前缓存的数据
		/// </summary>
		void Clear();
	}

}